class WorkflowActionGenerator < Rails::Generator::NamedBase
  attr_accessor :input_classes, :output_class
  
  def initialize(*runtime_args)
    super(*runtime_args)
    for arg in args
      if arg.index(':')
        field, value = arg.split(':')
        case field
        when 'input_classes'
          @input_classes = value
        when 'output_class'
          @output_class = value
        end
      end
    end
  end
  
  def manifest
    record do |m|
      m.template 'workflow_action.rb', File.join('app', 'models', "#{file_name}_action.rb")
    end
  end
end
